import request from '@/router/axios';

// 库存中心
export const getStockCenter = (id) => {
    return request({
        url: 'api/mes-admin/area/select/dept',
        method: 'get',
        params: {
            id
        }
    });
};

export const getList = (current, size, params) => {
    return request({
        // /mes-warehouse/sheetheader/page
        // /mes-warehouse/material/page
        url: '/api/mes-cloud/material/page',
        method: 'get',
        params: {
            ...params,
            current,
            size
        }
    });
};

// /mes-warehouse/receiving/undo-record

export const getListTable = (current, size, params) => {
    return request({
        url: '/api/mes-cloud/receiving/undo-record',
        method: 'get',
        params: {
            ...params,
            current,
            size
        }
    });
};

export const getListData = (id) => {
    return Request({
        url: '/api/mes-cloud/material/detail-list',
        method: 'get',
        params: {
            id
        }
    });
};

// /mes-warehouse/material/detail

export const getDetail = (id) => {
    return request({
        url: '/api/mes-cloud/material/detail-list',
        method: 'get',
        params: {
            id
        }
    });
};

export const remove = (ids) => {
    return request({
        url: '/api/mes-cloud/material/remove',
        method: 'post',
        params: {
            ids
        }
    });
};

export const add = (row) => {
    return request({
        url: '/api/mes-cloud/material/submit',
        method: 'post',
        data: row
    });
};

export const update = (row) => {
    return request({
        url: '/api/mes-cloud/material/submit',
        method: 'post',
        data: row
    });
};
